<?php

namespace api\modules\v1\controllers;

use yii\web\Controller;
use yii\rest\ActiveController;
use common\models\Admin;
use yii\filters\auth\HttpBasicAuth;
use yii\web\Response;

class HelloController extends ActiveController{
	public $modelClass = 'common\models\User';

	// public function behaviors(){
	//     $behaviors = parent::behaviors();
	//     $behaviors['contentNegotiator']['formats']['text/html'] = Response::FORMAT_HTML;
	//     return $behaviors;
	// }

	// public function actions(){
	//     $actions = parent::actions();

	//     // 禁用"delete" 和 "create" 动作
	//     unset($actions['delete'], $actions['create']);

	//     // 使用"prepareDataProvider()"方法自定义数据provider
	//     $actions['index']['prepareDataProvider'] = [$this, 'prepareDataProvider'];

	//     return $actions;
	// }

	public function actionIndex2(){
		echo 'hello';
	}

	public function actionTest(){
		$result=Admin::find()->asarray()->all();
		// var_dump($result);
		print_r($result);
	}

}

// class HelloController extends Controller{

// 	public function actionIndex(){
// 		echo 'hello hi';
// 	}

// 	public function actionTest(){
// 		$result=Admin::find()->asarray()->all();
// 		// var_dump($result);
// 		print_r($result);
// 	}
// }








 ?>